﻿@{
    var BemasIsTops = ViewData["BemasIsTops"] as List<HanGu.Entity.VBemaLecturerInfo>;
    var TravelIsTop = ViewData["TravelIsTop"] as List<HanGu.Entity.TravelStudy>;
}
<!--下面是向左滚动代码-->
<div id="colee_left" style="overflow: hidden; width: 680px;">
    <table cellpadding="0" cellspacing="0" border="0">
        <tr>
            <td id="colee_left1" valign="top" align="center">
                <table cellpadding="2" cellspacing="0" border="0">
                    <tr align="center">
                        @if (BemasIsTops != null && BemasIsTops.Count > 0)
                        {
                            foreach (var item in BemasIsTops)
                            {
                            <td style="padding-left: 5px; padding-right: 5px; width: 136px;">
                                <div class="movie_image_panel">
                                    @{item.TitlePic = item.TitlePic ?? "/Content/default.jpg";
                                        }
                                        <a href="/rostrum/Detail/@item.ID">
                                            <img src="@item.TitlePic" alt="@item.Title"></a>
                                    </div>
                                <div class="lineHidden">
                                    <a href="/rostrum/Detail/@item.ID">@item.Title</a></div>
                               @* <div>
                                    <span formatdate="yyyy年MM月dd日">@item.UpdateTime</span></div>*@
                            </td>
                            }
                        }
                        else if (TravelIsTop != null && TravelIsTop.Count > 0)
                        {
                            foreach (var item in TravelIsTop)
                            {
                            <td style="padding-left: 5px; padding-right: 5px">
                                <p class="movie_image_panel">
                                    @{item.TitlePic = item.TitlePic ?? "/Content/default.jpg";
                                        }
                                    
                                        <a href="/Travel/play/@item.ID">
                                            <img src="@item.TitlePic" alt="@item.Address"></a>
                                    </p>
                                <p class="lineHidden">
                                    <a href="/Travel/play/@item.ID">@item.Title</a></p>
                            </td>
                            }

                        }
                    </tr>
                </table>
            </td>
            <td id="colee_left2" valign="top">
            </td>
        </tr>
    </table>
</div>
<div id="ttttt">
</div>
<script>
    //使用div时，请保证colee_left2与colee_left1是在同一行上.
    var speed = 30//速度数值越大速度越慢
    var colee_left2 = document.getElementById("colee_left2");
    var colee_left1 = document.getElementById("colee_left1");
    var colee_left = document.getElementById("colee_left");
    colee_left2.innerHTML = colee_left1.innerHTML;
    function Marquee3() {
        temp = colee_left.scrollLeft;
        if (colee_left2.offsetWidth - colee_left.scrollLeft <= 0)//offsetWidth 是对象的可见宽度
        {
            colee_left.scrollLeft -= colee_left1.offsetWidth//scrollWidth 是对象的实际内容的宽，不包边线宽度
        }
        else {
            colee_left.scrollLeft++;
        }
    }
    var MyMar3 = setInterval(Marquee3, speed)
    colee_left.onmouseover = function () { clearInterval(MyMar3) }
    colee_left.onmouseout = function () { MyMar3 = setInterval(Marquee3, speed) }
</script>
<!--向左滚动代码结束-->
